import { defineStore } from 'pinia'
import { TransformControlsMode } from 'three/examples/jsm/Addons'
import { shallowRef } from 'vue'

export type ActionMode = TransformControlsMode | 'measure' | 'createdRoadway' | 'mergedRoadway'
export const useActionMode = defineStore('actionMode', () => {
  const currentMode = shallowRef<ActionMode>('translate')

  function setCurrentMode(mode: ActionMode) {
    currentMode.value = mode
  }

  return { currentMode, setCurrentMode }
})
